﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LDSP.Helper;

namespace LDSP.UI.Admin
{
    public partial class Left : LDSP.BRL.BaseSysAdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.LoginAdmin != null)
            {
                this.phd_superAdmin.Visible = this.LoginAdmin.IsSuper;
                this.phd_normalAdmin.Visible = !this.LoginAdmin.IsSuper;
                if (!LoginAdmin.IsSuper)
                {
                    var list = LoginAdmin.GetModuleList();
                    if (!list.Contains(ModuleName.CaseLib))
                    {
                        ph_na_caseLib.Controls.Clear();
                    }
                    if (!list.Contains(ModuleName.ChemicalMng))
                    {
                        ph_na_chemicalMng.Controls.Clear();
                    }
                    if (!list.Contains(ModuleName.Report))
                    {
                        ph_na_report.Controls.Clear();
                    }
                    if (!list.Contains(ModuleName.UserMng))
                    {
                        ph_na_userMng.Controls.Clear();
                    }
                }
            }
        }
    }
}